import request from '@/utils/request'
// import { func } from 'prop-types';
export function fetchList(depotId,params) {
  return request({
    url:'/home/block/list/'+depotId,
    method:'get',
    params:params
  })
}

export function createBlock(params) {
  return request({
    url:'/home/block/create',
    method:'post',
    data:params
  })
}
export function delBlock(id) {
    return request({
      url:'/home/block/del/'+id,
      method:'post',
    })
  }

export function getBlock(bid){
  return request({
    url:"/home/block/detail/"+bid,
    method:"get",
  })
}
  
export function updateBlock(id,data) {
  return request({
    url:'/home/block/update/'+id,
    method:'post',
    data:data
  })
}

export function bindProducts(params){
  return request({
    url:"/home/block/product/create",
    method:"post",
    data:params
  })
}

export function delbindedProducts(bid,pid){
  return request({
    url:"/home/block/del/product/"+bid,
    method:"post",
    data:pid
  })
}

export function getBindedProductList(bid){
  return request({
    url:"/home/block/product/list/"+bid,
    method:"get"
  })
}